package com.example.service;

import com.example.entity.*;
import jakarta.servlet.http.HttpSession;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface InitService {
    void commit();
    void rollback();
    //登录
    boolean userAuth(String u_account, String u_password, HttpSession session);
    User getUser(String account, String password);
    String getHashedPasswordByAccount(String account);
    boolean managerAuth(String m_account, String m_password, HttpSession session);
    Manager getManager(String m_account, String m_password);
    List<String> getTop4ArrivalCities();
    List<String> getTop4DepartureCities();
    Flight searchCheapestFlight(String departure, String destination, String departureDate);
    List<Flight> getFlightList(String departure_date);
    FlightStatus getFlightStatusById(int f_id);
    int updateFlightStatus(String status, int f_id);
    List<Ticket> getTicketList();
    int updateTicketStatus(int t_id);
    List<Order> getOrderList(String departure_date);
    Flight getFlightById(int f_id);
    int updateOrderStatus(int o_id);
    List<Order> getUnpaidOrderList();
    List<Ticket> getTicketListByOrderId(int o_id);
    int addEconomySpace(int f_id);
    int addBusinessSpace(int f_id);
    int addFirstSpace(int f_id);
    int deleteTicket(int o_id);
    int deleteOrder(int o_id);
    int updateMileage(int passenger_id, double mileage);
    Passenger getPassengerById(int passenger_id);
    int isUserExist(String ID_type, String ID_card);
    int updateGrade(String grade,String ID_type,String ID_card);
}
